package com.zyg.aspectj;

import org.aspectj.lang.ProceedingJoinPoint;

public class MyAspect {

	public void before() throws Throwable{
		System.out.println("前置通知");
	}
	
	public void afterReturning() throws Throwable{
		System.out.println("后置通知");
	}
	
	public void throwing(Throwable e) throws Exception{
		System.out.println("异常通知："+e.getMessage());
	}
	
	public void after() throws Throwable{
		System.out.println("最终通知");
	}
	
	public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable{
		System.out.println("环绕通知前");
		Object obj = proceedingJoinPoint.proceed();
		System.out.println("环绕通知后");
		return obj;
	}
	
}
